<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="../../js/constant/url.js"></script>
    <link rel="stylesheet" href="css/login.css">
    <title>登录</title>
</head>

<body>
    <div id="app">
        <div class="login-container">
            <div class="logo">
                <h1>登 &emsp; 录</h1>
            </div>
            <form @submit.prevent="handleLogin">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" id="username" v-model="username" required>
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" id="password" v-model="password" required>
                </div>
                <div>
                    <label for="remember-me">
                        <input type="checkbox" id="remember-me" :checked="rememberMe" @change="toggleRememberMe"> 记住我
                    </label>
                </div>
                <button type="submit" class="login-btn" :disabled="loading">
                    {{ loading ? '登录中...' : '登录' }}
                </button>
            </form>
            <div class="links">
                <a href="./register.html">没有账号？去注册</a>
            </div>
        </div>
        

        <!-- Toast -->
        <div class="toast-container" v-if="toast.show">
            <div class="toast" :class="toast.type">
                {{ toast.message }}
            </div>
        </div>
    </div>
    <script src="js/login.js"></script>
</body>

</html>